package org.diting.collections;

import java.util.Iterator;

class IterableGroup<TKey, TElement> implements IGrouping<TKey, TElement> {

	public IterableGroup(TKey key, Iterable<TElement> source)
	{
		this._key = key;
		this._source = source;
	}

	
	private Iterable<TElement> _source;
	private TKey _key;
	
	@Override
	public Iterator<TElement> iterator() {
		return this._source.iterator();
	}

	@Override
	public TKey getKey() {
		return this._key;
	}

	@Override
	public Query<TElement> toQuery() {
		return new Query<TElement>(this._source);
	}
	
	
	

}
